/**
 * Created by Administrator on 2017/2/27.
 */
var Input = require('../../../src/libs/input');
var Password = require('../../../src/libs/password');
var Button = require('../../../src/libs/button');
var HyperLink = require('../../../src/libs/hyperlink');
var FormItem = require('../../../src/libs/form-item');
var GetCode = require('../../../src/libs/get-code');
var Checkbox = require('../../../src/libs/checkbox');

var Root = React.createClass({
    componentDidMount: function(){
        UEventHub.emit("pageLoad","hello world!");

        var PageDM = window.PageDM;
        UEventHub.on(PageDM.imgCode.dmbind + UI_EVENT_CONST.SET_UDM_VALUE_EVENT,function(v){
            var _node = this.refs.imgcode;
            _node.setAttribute('src',v);
        }.bind(this));

        UEventHub.on(PageDM.checkboxDM.dmbind + UI_EVENT_CONST.SET_UDM_VALUE_EVENT,function(v){
            PageDM.checkboxDM.onClick(v);
        }.bind(this));
    },
    render: function() {
        return (
            <div>
                <div className="header">
                    <div className="top-bar fc-light">
                        <div className="container"> <span>服务热线：0816-2373017</span> <span>服务时间：工作日 9:00-18:00</span> <span className="nav-right"> <a href="登录.html">登录</a> <a href="注册.html">注册</a> <a href="../帮助中心/平台介绍.html">帮助中心</a> <a href="../index.html">返回绵阳商业银行</a> </span> </div>
                    </div>
                    <div className="header-nav">
                        <div className="container">
                            <div className="logo f-left">
                                <a href="../index.html"><img src="../images/logo.jpg" alt=""/> </a>
                                <a href="../index.html"><img src="../images/logoe.jpg" alt=""/> </a>
                            </div>
                            <div className="nav f-right">
                                <ul className="clearfix">
                                    <li><a href="../index.html">首页</a></li>
                                    <li><a href="../我要投资.html">我要投资</a></li>
                                    <li><a href="../我要借款.html">我要借款</a></li>
                                    <li><a href="../账户中心/我的账户.html">我的账户</a></li>
                                </ul>
                            </div>
                            <div className="clear"></div>
                        </div>
                        <div className="shadow"></div>
                    </div>
                </div>

                <div className="container mod-reg"> <span className="angle angle-top"></span> <span className="angle angle-bottom"></span>
                    <div className="form">
                        <div className="reg-tab">
                            <ul>
                                <li className="current"><b>个人注册</b><span className="bg"></span></li>
                                <li>企业注册<span className="bg"></span></li>
                                <div className="clear"></div>
                            </ul>
                        </div>
                        <div className="form-reg">
                            <FormItem label={PageDM.input1.label} id={PageDM.input1.id} dmbind={PageDM.input1.dmbind}>
                                <Input className="ucs-input" name={PageDM.input1.name} placeholder="请输入手机号码" value={PageDM.input1.value} dmbind={PageDM.input1.dmbind}/>
                            </FormItem>
                            <FormItem label={PageDM.input2.label} dmbind={PageDM.input2.dmbind}>
                                <input id={PageDM.input2.id} className="ucs-input ucs-input-code" type="text" name={PageDM.input2.name} placeholder="请输入图形验证码" value={PageDM.input2.value} dmbind={PageDM.input2.dmbind}/>
                                <HyperLink text={<img src={PageDM.imgCode.value} className="f-left img-code" ref="imgcode" style={{height:"40px"}}/>} onclick={PageDM.imgCode.onClick}/>
                            </FormItem>
                            <FormItem label={PageDM.msgDM.label} id={PageDM.msgDM.id} name={PageDM.msgDM.name} placeholder="请输入短信验证码" value={PageDM.msgDM.value} dmbind={PageDM.msgDM.dmbind}>
                                <input id={PageDM.msgDM.id} name={PageDM.msgDM.name} className="ucs-input ucs-input-code" placeholder="请输入短信验证码" value={PageDM.msgDM.value} dmbind={PageDM.msgDM.dmbind}/>
                                <GetCode id={PageDM.getBtnCode.id} className="btn-code btn ucs-btn" ref="getcode" count={PageDM.getBtnCode.count} onclick={PageDM.getBtnCode.onClick}/>
                            </FormItem>
                            <FormItem label={PageDM.pswDM.label} id={PageDM.pswDM.id} dmbind={PageDM.pswDM.dmbind}>
                                <Password className="ucs-input" name={PageDM.pswDM.name} placeholder="请设置登录密码" value={PageDM.pswDM.value} dmbind={PageDM.pswDM.dmbind}/>
                            </FormItem>
                            <FormItem label={PageDM.pswDM2.label} id={PageDM.pswDM2.id} dmbind={PageDM.pswDM2.dmbind}>
                                <Password className="ucs-input" name={PageDM.pswDM2.name} placeholder="请再次输入登录密码" value={PageDM.pswDM2.value} dmbind={PageDM.pswDM2.dmbind}/>
                            </FormItem>
                            <FormItem label={PageDM.tjDM.label} id={PageDM.tjDM.id} dmbind={PageDM.tjDM.dmbind}>
                                <Input className="ucs-input" name={PageDM.tjDM.name} placeholder="请输入推荐码" value={PageDM.tjDM.value} dmbind={PageDM.tjDM.dmbind}/>
                            </FormItem>
                            <div className="ucs-form-group">
                                <label>&nbsp;</label>
                                <div className="input">
                                    <Checkbox checked={PageDM.checkboxDM.setChecked} ref="checkedbox" id={PageDM.checkboxDM.id} text="我已阅读并同意" onclick={PageDM.checkboxDM.onClick} className="reg-checkbox"/>
                                    <a href={PageDM.URL.agreement} className="fc-link"> 《 绵阳市商业银行平台服务协议（个人版）》 </a>
                                </div>
                            </div>
                            <div className="ucs-form-group auto-height">
                                <label>&nbsp;</label>
                                <div className="input">
                                    <Button value="注册" id={PageDM.btn1.id} className="btn-confirm btn btn-width" onclick = {PageDM.btn1.onClick}/>
                                </div>
                            </div>
                        </div>
                        <div className="clear"></div>
                    </div>
                    <div className="reg-login"> <span className="or">or</span>
                        <div className="txt">
                            <p>已有平台账号</p>
                            <p><a href={PageDM.URL.login} className="fc-link"> 直接登录<i className="icon-go iconfont"></i></a></p>
                        </div>
                    </div>
                </div>

                <div className="footer">
                    <div className="container">
                        <div className="footer-logo f-left">
                            <p className="logo-foot"><img src="../images/foot-logo.png" alt=""/></p>
                            <p className="txt">2005－2013 绵阳市商业银行股份有限公司 <a href="http://www.miitbeian.gov.cn" target="_blank">粤ICP备11013283123号</a> </p>
                        </div>
                        <div className="footer-nav f-right">
                            <div className="col">
                                <h3>关于我们</h3>
                                <ul>
                                    <li><a href="../帮助中心/平台介绍.html">平台介绍</a></li>
                                    <li><a href="../帮助中心/名词解释.html">名词解释</a></li>
                                    <li><a href="../帮助中心/联系我们.html">联系我们</a></li>
                                    <li><a href="../帮助中心/服务协议.html">服务协议</a></li>
                                </ul>
                            </div>
                            <div className="col">
                                <h3>安全保障</h3>
                                <ul>
                                    <li><a href="../帮助中心/安全保障.html">项目安全</a></li>
                                    <li><a href="../帮助中心/安全保障.html">资金安全</a></li>
                                    <li><a href="../帮助中心/安全保障.html">信息安全</a></li>
                                    <li><a href="../帮助中心/安全保障.html">账户安全</a></li>
                                </ul>
                            </div>
                            <div className="col">
                                <h3>帮助中心</h3>
                                <ul>
                                    <li><a href="../帮助中心/投资操作指引.html">投资指引</a></li>
                                    <li><a href="../帮助中心/融资操作指引.html">融资指引</a></li>
                                    <li><a href="../帮助中心/平台公告.html">平台公告</a></li>
                                    <li><a href="javascript:;">常见问题</a></li>
                                </ul>
                            </div>
                            <div className="col col-service">
                                <p>客服专线<br/>0816-2373017</p>
                                <p>服务时间<br/>工作日9:00 - 18:00</p>
                            </div>
                        </div>
                        <div className="clear"></div>
                    </div>
                </div>
            </div>
        )
    }
});
ReactDOM.render(<Root/>, document.getElementById('main'));